﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;

namespace mvc.Controllers
{
    public class AsController : Controller
    {
        
        /// <summary>
        /// 登陆
        /// </summary>
        /// <returns></returns>
        public ActionResult login()
        {
            var res = new JsonResult();  
            StringBuilder sb = new StringBuilder();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            sb.Append("{\"code\":200,\"list\":null,\"map\":null,\"msg\":\"操作成功\",\"obj\":{\"email\":null,\"headImg\":null,\"id\":817122,\"idNum\":null,\"idPhoto\":null,\"loginName\":\"28D8D084D4BE19FFE62115BBDAC50266\",\"name\":\"无边宇宙\",\"phone\":\"\",\"qq\":\"\",\"regTime\":1419493820000,\"roleIdList\":[],\"sex\":0,\"status\":0,\"tel\":null,\"type\":0,\"xd\":0,\"property\":\"{\\\"myTplId\\\":1177827}\"},\"success\":true}");
            res.Data = serializer.DeserializeObject(sb.ToString());
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。
            return res;
        }
        /// <summary>
        /// 当前模板所有页面
        /// </summary>
        /// <returns></returns>
        public ActionResult editAs()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/editAs.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
        /// <summary>
        /// 获取单页详情
        /// </summary>
        /// <returns></returns>
        public ActionResult scenedesign()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/scenedesign.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }

        public ActionResult my()
        {
            var res = new JsonResult();
            StringBuilder sb = new StringBuilder();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            sb.Append("{\"success\":true,\"code\":200,\"msg\":\"操作成功\",\"list\":[]}");
            res.Data = serializer.DeserializeObject(sb.ToString());
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。
            return res;
        }
        /// <summary>
        /// 我的音乐
        /// </summary>
        /// <returns></returns>
        public ActionResult userList()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/userList.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
        /// <summary>
        /// 获取模板分类
        /// </summary>
        /// <returns></returns>
        public ActionResult GetCategory()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/GetCategory.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
        /// <summary>
        /// 系统图片库
        /// </summary>
        /// <returns></returns>
        public ActionResult sysFileList()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/sysFileList.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
        /// <summary>
        /// 切换编辑页，保存修改
        /// </summary>
        /// <returns></returns>
        public ActionResult scenesave()
        {
            var res = new JsonResult();
            StringBuilder sb = new StringBuilder();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            sb.Append("{\"success\":true,\"code\":200,\"msg\":\"操作成功\",\"obj\":null,\"map\":null,\"list\":null}");
            res.Data = serializer.DeserializeObject(sb.ToString());
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。
            return res;
        }
        /// <summary>
        /// 获取所有模板分类
        /// </summary>
        /// <returns></returns>
        public ActionResult GetAllCategory()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/GetAllCategory.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
        /// <summary>
        /// 获取所有模板
        /// </summary>
        /// <returns></returns>
        public ActionResult templatelist()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/templatelist.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
        /// <summary>
        /// 更换页面模板
        /// </summary>
        /// <returns></returns>
        public ActionResult pageTpl()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/pageTpl.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
        /// <summary>
        /// 调整页面顺序
        /// </summary>
        /// <returns></returns>
        public ActionResult changePageSort()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/changePageSort.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
        /// <summary>
        /// 新增页面
        /// </summary>
        /// <returns></returns>
        public ActionResult createPage()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/createPage.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
        /// <summary>
        /// 删除页面
        /// </summary>
        /// <returns></returns>
        public ActionResult delPage()
        {
            var res = new JsonResult();
            StringBuilder sb = new StringBuilder();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            sb.Append("{\"success\":true,\"code\":200,\"msg\":\"操作成功\",\"obj\":null,\"map\":null,\"list\":null}");
            res.Data = serializer.DeserializeObject(sb.ToString());
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。
            return res;
        }
        /// <summary>
        /// 把页面添加到我的
        /// </summary>
        /// <returns></returns>
        public ActionResult mysave()
        {
            var res = new JsonResult();
            StringBuilder sb = new StringBuilder();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            sb.Append("{\"success\":true,\"code\":200,\"msg\":\"操作成功\",\"obj\":1177827,\"map\":null,\"list\":null}");
            res.Data = serializer.DeserializeObject(sb.ToString());
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。
            return res;
        }

        /// <summary>
        /// 页面设置
        /// </summary>
        /// <returns></returns>
        public ActionResult GetTradeType()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/GetTradeType.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }

        /// <summary>
        /// 场景详情
        /// </summary>
        /// <returns></returns>
        public ActionResult GetSceneDetial()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/GetSceneDetial.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }

        /// <summary>
        /// 切换
        /// </summary>
        /// <returns></returns>
        public ActionResult sceneTransition()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/sceneTransition.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }

        public ActionResult sys()
        {
            var res = new JsonResult();
            StringBuilder sb = new StringBuilder();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            sb.Append("{\"success\":true,\"code\":200,\"msg\":\"操作成功\",\"obj\":null,\"map\":null,\"list\":[]}");
            res.Data = serializer.DeserializeObject(sb.ToString());
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。
            return res;
        }

        /// <summary>
        /// 我的页面模板
        /// </summary>
        /// <returns></returns>
        public ActionResult customlist()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/customlist.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }

        public ActionResult getAddressEdit()
        {
            var res = new JsonResult();
            StringBuilder sb = new StringBuilder();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            sb.Append("{\"success\":true,\"code\":200,\"msg\":\"操作成功\",\"obj\":null,\"map\":null,\"list\":[]}");
            res.Data = serializer.DeserializeObject(sb.ToString());
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。
            return res;
        }

        /// <summary>
        /// 复制模版
        /// </summary>
        /// <returns></returns>
        public ActionResult CopyTemplatePage()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/CopyTemplatePage.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }

        /// <summary>
        /// 添加到我的音乐
        /// </summary>
        /// <returns></returns>
        public ActionResult userAddMusic()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/userAddMusic.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }
    }
}
